package luigibros.displayComponents;
import luigibros.logic.ScreenOccupant;
import java.util.Map;
import java.awt.Image;
import java.awt.Rectangle;
import java.util.concurrent.Semaphore;
/**
 * This class will handle the Semaphore and the sprites for each
 * ScreenOccupant. Will release the kracken if used properly. It 
 * will also handle their current phase of animation and proxying 
 * their collisions.
 * @author andrew92592
 *
 */
public class Character  {
	private Semaphore idk;
	private ScreenOccupant dood;
	private Image lePic;

	/**
	 * It's a constructor! But you should know that already. :P
	 * @param x - number of permits for the semaphore
	 * @param guy - We're not sure what is is for, but We must have it..
	 * @param seagull - Seagulls are awesome, so We've name the image you send us after one.
	 */
	public Character(int x,ScreenOccupant guy,Image seagull)
	{
		//could be
		idk = new Semaphore(x);
		dood = guy;
		lePic = seagull;
	}
	/**
	 * Returns the ScreenOccupant for this character
	 * Maybe. 
	 * We aren't sure what this method should do. So it 
	 * does this. We hope you don't mind.
	 * @return dood, the ScreenOccupant We've saved in a field
	 */
	public ScreenOccupant getScreenOccupant()
	{
		//correct? or incorrect? We'll never know
		return dood;
	}
	
	/**
	 * This makes something go next. We've been told the Semaphore 
	 * goes in here.Currently it acquires a permit, then immediately 
	 * returns it. We've also decided to call luigi.Magic(), because 
	 * it seemed like a good idea at the time.
	 */
	public void next()
	{
		idk.acquire();
		//call luigi.Magic()
		idk.release();
	}
	/**
	 * Oh sweet Baldur, where to begin? We've NO clue what this supposed to do.
	 * So We've decided to bet on humor and call luigi.moreMagic() and hope for
	 * the best. We ask for mercy.
	 */
	public void handleCollision(Map<Rectangle, ScreenOccupant> superMap)
	{
		//call luigi.moreMagic()
	}
	/**
	 * See the javadoc for getScreenOccupants. It's the same idea really.
	 * Also, We decided to call luigi.stillMoreMagic(), becaue you can't have
	 * enough of a good thing.
	 * @return lePic - The stored image. We hoped you'd be smart enough to know that on your own.
	 */
	public Image getImage()
	{
		//call luigi.stillMoreMagic()
		return lePic;
		
	}

}

